<?=$this->render ( 'public/left.phtml' );?>
<div class="admin-right">
<div class="admin-menu">
<li><a href="/admin/site">小站列表</a></li>
<li><a href="/admin/site/site/do/create">创建小站</a></li>
<li><a href="/admin/site/category">小站分类</a></li>
<li><a href="/admin/site/category/do/create">创建分类</a></li>
</div>

<div class="clear"></div>

<?php
if ($this->do == 'create') {?>
<div class="menu"><a href="/admin/site/category">小站分类</a>>创建</div>
<div class="admin-create">

<form id="site" name="form1" method="post"
	action="/admin/site/category/do/create/">
<div class="title">新建分类</div>
<table>
	<tr>
		<td>分类名称</td>
		<td><input type="text" name="category_name" id="category_name" class="input" /></td>
	</tr>
	<tr>
		<td>父分类</td>
		<td>
		  <select name="category_id" id="category_fid">
		    <option value="0">一级分类</option>
            <?php 
			foreach($this->categoryFirst as $cate){ 
				echo "<option value='".$cate['category_id']."'>".$cate['category_name']."</option>";
			}
			?>
	      </select>
          </td>
	</tr>
	<tr>
		<td>分类介绍</td>
		<td><textarea name="category_intro" id="category_intro" cols="45" rows="5"
			class="input1" maxH=0 ></textarea></td>
	</tr>
	<tr>
		<td>&nbsp;</td>
		<td><input type="submit" value="提交" /></td>
	</tr>
</table>
</form>

<?
}
elseif ($this->do == 'edit') {
	?>
<div class="menu"><a href="/admin/site/category">小站分类</a>>编辑</div>
<div class="admin-create">
<form id="site" name="form1" method="post"
	action="/admin/site/category/do/edit">
<div class="title">编辑分类</div>
<table>
  <tr>
    <td>分类名称</td>
    <td><input type="text" name="category_name" id="category_name" class="input" value="<?=$this->categoryInfo['category_name']?>" /></td>
  </tr>
  <tr>
    <td>父分类</td>
    <td><label for="category_fid"></label>
      <select name="category_fid" id="category_fid">
        <option value="0">父分类</option>
      </select></td>
  </tr>
  <tr>
    <td>分类介绍</td>
    <td><textarea name="category_intro" id="category_intro" cols="45" rows="5" class="input1" maxh="0" ><?=$this->categoryInfo['category_intro']?> </textarea></td>
  </tr>
  <tr>
    <td>&nbsp;</td>
    <td><input type="submit" value="提交" />
      <input name="category_id" type="hidden" id="category_id" value="<?=$this->categoryInfo['category_id']?>" /></td>
  </tr>
</table>
</form>
</div>
<?
}else{
?>
<?php
	foreach ( $this->categoryList as $item ) {
?>
  <p><a href="#"><?=$item ['category_name']?></a><span class="admin-do"><a href="/admin/site/category/do/edit/category_id/<?=$item ['category_id']?>">编辑</a>,<a href="">删除</a></span></p>
<?
	}
?>
<?
}
?>
</div>
<!-- end admin-create--></div>
<!-- end admin-right-->



